Repository navigation
fix(docs): restore fenced code block contrast inside callouts - #1212
Merged
Merged
Conversation
After upgrading @vercel/geistdocs to 3.1.5 in #1200, CalloutContainer applies [&_code]:bg-*-300! and [&_code]:text-*-1000! with !important on warn/warning, error, success, and idea callouts. That selector also matches <pre><code> inside fenced code blocks and overrides CodeBlock's non-important [&_code]:bg-transparent, painting a tinted background behind Shiki tokens. In dark mode on /adapters/official/github, this caused docs-a11y to fail with two color-contrast violations. Add a scoped .geistdocs-callout pre > code rule inside @layer utilities in apps/docs/app/styles/geistdocs.css so higher specificity wins over Tailwind's !important utilities in the same cascade layer. This restores a transparent background, --ds-gray-1000 text color, and 13px font size for fenced code blocks inside callouts while leaving inline <code> untouched. Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the failing
docs-a11yCI check introduced after bumping@vercel/geistdocsto3.1.5in #1200.In
@vercel/geistdocs@3.1.5,CalloutContainerapplies[&_code]:bg-*-300!and[&_code]:text-*-1000!with!importantforwarn/warning,error,success, andideacallouts (in addition to[&_code]:text-[12px]!). That selector also matches<pre><code>inside fenced code blocks and overridesCodeBlock's non-important[&_code]:bg-transparent. On/adapters/official/github(apps/docs/content/adapters/official/github.mdx), painting--ds-amber-300behind Shiki tokens in dark mode dropped contrast below WCAG AA and faileddocs-a11yon 2 elements.This PR adds a
.geistdocs-callout pre > codeoverride inside@layer utilitiesinapps/docs/app/styles/geistdocs.css. Because CSS cascade layers invert for!important, placing the higher-specificity selector in@layer utilitiesoverrides Tailwind's[&_code]:*!utilities without affecting inline<code>elements. It restores a transparent background,--ds-gray-1000text color, and13pxfont size for fenced code blocks across all callout variants in both light and dark modes.Test plan
pnpm check(passed, exit code 0).pnpm turbo build --filter=docs(passed, exit code 0; 341 static pages generated).@axe-core/playwrightcheck against/adapters/official/githubon a localnext startserver using Chrome (channel: "chrome"): bothlightanddarkmodes reported 0 non-known WCAG 2.2 A/AA violations,backgroundColor: rgba(0, 0, 0, 0)andfontSize: 13pxon.geistdocs-callout pre > code, and12pxpreserved on inline.geistdocs-callout p > code.docs-a11yjob will verify all 218 page checks against Playwright's bundled Chromium.Checklist
git commit -s)pnpm validatepasses (ranpnpm checkandpnpm turbo build --filter=docs; full workspace validation left to CI)